package com.vimi8.chick.plugins.manager;

import android.content.Context;

import com.eros.framework.constant.Constant;
import com.eros.framework.manager.Manager;
import com.eros.framework.model.UploadImageBean;
import com.vimi8.chick.plugins.adapter.PictureAdapter;
import com.vimi8.chick.plugins.model.PictureBean;
import com.vimi8.chick.plugins.model.UploadObjectBean;
import com.vimi8.chick.plugins.model.VideoBean;

import java.util.HashMap;
import java.util.List;

public class PictureManager extends Manager {

    @Override
    public HashMap<String, HashMap<String, String>> getComponentsAndModules() {
        HashMap<String, HashMap<String, String>> result = new HashMap<>();

        HashMap<String, String> moudles = new HashMap<>();
        moudles.put("vmPicture", "com.vimi8.chick.plugins.module.pictureModule");
        result.put(Constant.CUSTOMER_MODULES, moudles);

        return result;
    }

    /**
     * 选择多张图片
     * @param context
     * @param bean
     * @param requestCode
     */
    public void pickPhoto(final Context context, PictureBean bean, int requestCode) {
        PictureAdapter.getInstance().pickPhoto(context, bean,requestCode);
    }

    /**
     * 选择单张图片，裁剪
     */
    public void pickAvatar(final Context context, PictureBean bean,int requestCode) {
        PictureAdapter.getInstance().pickAvatar(context, bean,requestCode);
    }

    /**
     * 上传多张图片
     * @param context
     * @param items
     * @param bean
     */
    public void UpMultipleImageData(Context context, List<String> items, UploadImageBean bean) {
        PictureAdapter.getInstance().UpMultipleImageData(context, items, bean);
    }

    /**
     * 打开照相器 拍照
     */
    public void openCamera(Context context, PictureBean bean, int requestCode) {
        PictureAdapter.getInstance().openCamera(context, bean, requestCode);
    }

    /**
     * 视频
     */
    public void openVideo(Context context, VideoBean bean, int requestCode) {
        PictureAdapter.getInstance().openVideo(context, bean, requestCode);
    }

    /**
     * 视频预览
     */
    public void videoPreview(Context context, UploadImageBean bean) {
        PictureAdapter.getInstance().videoPreview(context, bean);
    }

    /**
     * 上传多个OSS对象
     *
     * @param items 选择对象集合
     * @param bean  uplaod 参数对象
     */
    public void uploadObject(Context context, List<String> items, UploadObjectBean bean) {
        PictureAdapter.getInstance().uploadObject(context, items, bean);
    }
}
